/*
 * @Author: li bo
 * @Date: 2025/07/09 17:40:53
 * @LastEditors: li bo
 * @Description: "艺术家模型"
 */
module.exports = (sequelize, Sequelize) => {
    return sequelize.define("artist", {
        id: {
            type: Sequelize.UUID,
            notNull: true,
            primaryKey: true,
            comment: '唯一标识',
            defaultValue: Sequelize.UUIDV4,
        },
        name: {
            type: Sequelize.STRING(100),
            allowNull: false,
            unique: true,
            comment: '艺术家名称'
        },
        bio: {
            type: Sequelize.TEXT,
            comment: '艺术家简介'
        },
        avatarUrl: {
            type: Sequelize.STRING(255),
            comment: '艺术家头像',
            defaultValue: '../../public/web-site/website-avatar.jpg',
            field: 'avatar_url'
        },
    }, {
        tableName: 'artist',
        comment: '艺术家信息表',
        indexes: [
            {
                unique: true, // 唯一索引
                fields: ['name']
            }
        ]
    })
}